package com.zzyl.nursing.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * SpringTask入门
 * 1.启动类添加注解 @EnableScheduling
 * 2.定时任务方法上添加 @Scheduled(cron表达式)
 */
@Component
@Slf4j
public class MyTask {
    @Scheduled(cron = "0/5 * * * * ?")
    public void executeTask(){
        log.warn("SpringTask定时任务开始执行....");
    }
}
